package com.rx.school.vo.relation;

import com.rx.core.data.RxData;
import com.rx.core.iface.RelationQuery;
import com.rx.core.util.RxUtil;
import com.rx.school.vo.SchArticleInfo;
import com.rx.school.vo.SchMenuInfo;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

@RxData
@Data
@EqualsAndHashCode(callSuper = true)
public class DoubleSchMenuInfo extends SchMenuInfo implements RelationQuery {
    Object relation;

    List<SchArticleInfo> records;

    @Override
    public void assignRelation(Object object) {
        this.relation = object;
    }

    @Override
    public Object obtainRelation() {
        return relation;
    }


    public static DoubleSchMenuInfo create(SchMenuInfo  schMenuInfo ){
        DoubleSchMenuInfo doubleTangNousInfo = new DoubleSchMenuInfo();
        RxUtil.copyProperties(schMenuInfo,doubleTangNousInfo);
        return doubleTangNousInfo;
    }
}
